package org.benjamin.lending.controller;

import org.benjamin.lending.domain.entity.WithdrawalsLog;
import org.benjamin.lending.domain.form.WithdrawForm;
import org.benjamin.lending.domain.form.WithdrawIndex;
import org.benjamin.lending.service.MemberInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping(value = "manager/withdraw")
public class ManagerWithdrawController {
	
	@Autowired
	private MemberInfoService memberInfoService;
	
	@RequestMapping(value  = "index")
	public ModelAndView index(@ModelAttribute("withdrawIndex")WithdrawIndex withdrawIndex,Pageable pageable) {
		ModelAndView modelAndView = new ModelAndView("admin.withdraw.index");
		Page<WithdrawalsLog> withdrawalsLogPage = this.memberInfoService.findWithdrawLogPage(withdrawIndex,pageable);
		modelAndView.addObject("withdrawalsLogPage",withdrawalsLogPage);
		return modelAndView;
	}

}
